<template>
  <div class="image-icon">
    <div class="bluck">
      <el-image :src="props.url" :fit="fill">
        <template #error>
          <div class="image-slot">
            <el-icon><icon-picture /></el-icon>
          </div>
        </template>
      </el-image>
    </div>
  </div>
</template>
<script setup lang="ts">
import { Picture as IconPicture } from "@element-plus/icons-vue";
const props = defineProps({
  url: { type: Object, required: true }
})
</script>

<style scoped>
.image-icon .bluck {
  text-align: center;
  display: inline-block;
  width: var(--my-width);
  height: var(--my-height);
  box-sizing: border-box;
  vertical-align: top;
}
.image-icon .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
.image-icon .el-image {
  width: 100%;
  height: 100%
}

.image-icon .image-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: var(--el-fill-color-light);
  color: var(--el-text-color-secondary);
  font-size: 30px;
}
.image-icon .image-slot .el-icon {
  font-size: 30px;
}
</style>
